package com.dhy.scanercode;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.ListView;

import com.dhy.R;
import com.dhy.utils.Config;

public class ListActivity extends AppCompatActivity {

    private Button backBtn;
    private ListView lv;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_list);

        lv = findViewById(R.id.lv);
        backBtn = findViewById(R.id.back);

        backBtn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                ListActivity.this.finish();
            }
        });

        ArrayAdapter<String> adapter = new ArrayAdapter<String>(
                ListActivity.this, android.R.layout.simple_list_item_1, Config.PHONE_LIST);
        lv.setAdapter(adapter);
    }
}
